package com.collabscm.waf.solution.validation;

import java.util.Set;

import com.collabscm.waf.exception.ValidationFailure;

/**
 * Bean属性验证失败，即表示Bean中的一些属性不符合要求
 *
 * @author Zeng Raoxing
 */
public class BeanValidationFailure extends ValidationFailure {
	private static final long serialVersionUID = 1L;
	/**
	 * 违反的约束条件
	 */
	private Set<?> constraintSet;
	/**
	 * 验证出错的Bean的名称
	 */
	private String rootBean;

	public BeanValidationFailure(Class<?> beanClass, Set<?> constraints) {
		super(beanClass);
		constraintSet = constraints;
	}

	/**
	 * 得到所有的违反约束的信息
	 */
	public Set<?> getConstraints() {
		return this.constraintSet;
	}
	
	public String getRootBean() {
		return rootBean;
	}

	public void setRootBean(String rootBean) {
		this.rootBean = rootBean;
	}

}
